Rename test functions to follow repository conventions#228
Merged
josecelano merged 13 commits intomainfrom Dec 12, 2025
Merged
Conversation
…entions Renamed 23 test functions from test_* to it_should_*_when_* pattern to align with repository conventions defined in docs/contributing/testing/unit-testing.md Tests: All 23 tests pass Linters: All linters pass
Renamed 10 test functions from test_* to it_should_*_when_* pattern. Tests: All 10 tests pass Linters: Pass
Renamed 9 test functions to follow conventions. Tests: All 9 tests pass
Renamed 9 test functions (4 in tracker_core_section.rs, 5 in tracker_section.rs). Tests: All tests pass
Renamed 2 test functions in create_tracker_storage.rs and init_tracker_database.rs. Tests: All tests pass
Renamed 7 test functions. Tests: All tests pass
Renamed 5 test functions in env.rs and project_generator.rs. Tests: All tests pass
Renamed 3 helper functions from test_* to fixture_* prefix to clarify they are test fixtures, not actual tests. Updated all call sites. Tests: All tests pass
Renamed 6 test functions and 1 helper function in test controllers and reentrancy tests. Tests: All tests pass
Renamed credential methods from test_username/test_password to username/password and test_ssh_connection to verify_ssh_connection. Updated all call sites. Tests: All tests pass
Renamed 4 integration test functions. Tests: All tests pass
All test functions and helper functions have been renamed to follow conventions. 93 test functions and 14 helper functions renamed across 20 files. All tests pass. All linters pass.
- Add rule #15 to Essential Rules section in AGENTS.md - Emphasizes CRITICAL importance of using it_should_* pattern - Explicitly forbids test_* prefix for test function names - References docs/contributing/testing/unit-testing.md for details - Includes examples of correct vs incorrect naming - Preventive measure to avoid future test naming violations
Member
Author
|
ACK d4ed0ad |
josecelano
added a commit
that referenced
this pull request
Dec 12, 2025
- Move entry from active-refactorings.md to completed-refactorings.md - Add completion details (93 test functions, 14 helpers, 20 files, PR #228) - Delete refactoring plan document (work now in git history) - Clear active-refactorings.md table (no active refactorings)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR systematically renames all unit test functions and helper functions that use the
test_prefix to follow the repository's established naming convention using theit_should_prefix with behavior-driven naming.Changes
Test Functions Renamed
test_*toit_should_*_when_*orit_should_*_given_*patterntest_*tofixture_*or appropriate descriptive namesFiles Modified (20 files)
Phase 0 - Core Application Layer:
src/application/command_handlers/create/config/environment_config.rs(23 tests)src/application/command_handlers/create/config/errors.rs(10 tests)src/application/command_handlers/create/config/ssh_credentials_config.rs(9 tests)src/application/command_handlers/create/config/tracker/tracker_core_section.rs(4 tests)src/application/command_handlers/create/config/tracker/tracker_section.rs(5 tests)src/application/steps/application/create_tracker_storage.rs+init_tracker_database.rs(2 tests)Phase 1 - Infrastructure Layer:
7.
src/infrastructure/external_validators/running_services.rs(7 tests)8.
src/infrastructure/templating/docker_compose/template/renderer/env.rs(1 test)9.
src/infrastructure/templating/docker_compose/template/renderer/project_generator.rs(4 tests)10.
src/infrastructure/templating/tofu/template/common/renderer/project_generator.rs(3 helpers)Phase 2 - Presentation Layer:
11.
src/presentation/controllers/test/errors.rs(4 tests)12.
src/presentation/controllers/test/handler.rs(1 helper)13.
src/presentation/tests/reentrancy_fix_test.rs(2 tests)Phase 3 - Testing Utilities:
14.
src/testing/integration/ssh_server/mod.rs(2 trait methods)15.
src/testing/integration/ssh_server/real_container.rs(4 methods)16.
src/testing/integration/ssh_server/mock_container.rs(4 methods)17.
src/testing/e2e/containers/actions/ssh_wait.rs(1 helper)Phase 4 - Integration Tests:
18.
tests/template_integration.rs(4 tests)Benefits
docs/contributing/testing/unit-testing.mdTesting
Related
docs/refactors/plans/rename-test-functions-to-follow-conventions.mddocs/contributing/testing/unit-testing.mdChecklist